int lengthOfLastWord(char* s)
{
    int cal = 0;
    int length = strlen(s);
    int i = length - 1;
    while (i >= 0)
    {
        if (s[i] != ' ')
            cal++;
        if (i == 0)
            break;
        if (s[i] != ' ' && s[i - 1] == ' ')
            break;
        i--;
    }
    return cal;
}